#include "Conteiner.h"
Conteiner::Conteiner()
{
	entites = new Telist;
}

Conteiner::~Conteiner()
{
	Telist::iterator ei;
	Telist::iterator lei;
	Tclist::iterator ci;

	ei=entites->begin();
	lei=entites->end();

	for(ei;ei!=lei;++ei)
	{
		elist.push_back((*ei));
	}

	delete entites;
}

void Conteiner::Add(Entity *ent)
{
	elist.remove(ent);
	entites->push_back(ent);
}

void Conteiner::Remove(Entity *ent)
{
	entites->remove(ent);
	elist.push_back(ent);
}

void Conteiner::Render()
{
	Telist::iterator ei;
	Telist::iterator lei;
	Tclist::iterator ci;

	ei=entites->begin();
	lei=entites->end();

	for(ei;ei!=lei;++ei)
	{
		(*ei) -> Draw();
	}
}